<template>
    <van-button :loading="loading" @click="ClickHandle">
        <slot></slot>
    </van-button>
</template>

<script setup>
import { ref } from 'vue'
const props = defineProps(["click"])
const loading = ref();
function ClickHandle(event) {
    loading.value = true;
    props.click(event).finally(() => {
        loading.value = false;
    })
};
</script>